#include<bits/stdc++.h>
#define int long long
#define N 1000005
using namespace std;
int n,k;
int a[N];
int ans;
int fac[N];
const int mod=1e9+7;
int Pow(int x,int y){
    x%=mod;
    int z=1;
    while(y){
        if(y&1) z=z*x%mod;
        x=x*x%mod;
        y>>=1;
    }
    return z;
}
void init(){
    fac[0]=1;
    for(int i=1;i<=n;i++) fac[i]=fac[i-1]*i%mod;
}
int f(int x,int y){
    if(x-y-1<0) return 0;
    return fac[x-1]*Pow(fac[x-y-1],mod-2)%mod;
}
signed main(){
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
    scanf("%lld %lld",&n,&k);
    for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
    init();
    ans=f(n,k)*a[1]%mod;
    int p1=(f(n-1,k)-f(n-1,k-1)*k%mod+mod)%mod,p2=(f(n-1,k)-f(n-2,k-1)*k%mod+mod)%mod;
    for(int i=2;i<=n;i++){
        if(i==2) ans=(ans+p1*a[i]%mod)%mod;
        else ans=(ans+p2*a[i]%mod)%mod;
    }
    printf("%lld\n",ans*Pow(f(n,k),mod-2)%mod);
    return 0;
}